package com.xjrsoft.module.app.controller;

import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.module.app.service.IAppAuthorizeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hnyyzy
 * @since 2023-12-25
 */
@RestController
@RequestMapping(GlobalConstant.APP_MODEL +"/app-authorize")
@Api(value = GlobalConstant.APP_MODEL +"/app-authorize", tags = "app 权限模块")
@AllArgsConstructor
public class AppAuthorizeController {
    private final IAppAuthorizeService authorizeService;

    @GetMapping("/app-menu-permissions")
    @ApiOperation(value="app用户菜单权限数据返回")
    public R appMenuPermissions(@RequestParam(required = false) Long menuId){
        return R.ok(authorizeService.getAppPermissions(menuId));
    }
}
